<!--

    Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:fmd="http://java.sun.com/xml/ns/javaee/faces/design-time-metadata"
      xmlns:b="http://mojarra.dev.java.net/source1"
      xmlns:cc="http://java.sun.com/jsf/composite">
<head>

<title>Not present in rendered output</title>

</head>

<body>

<cc:interface 
    name="component"
    displayName="A really fancy composite component"
    expert="true"
    hidden="false"
    preferred="true"
    shortDescription="This component has all the supported metadata."
    extraTopLevelAttribute="Whatever I want here">

<!-- start top level attributes -->

  <cc:attribute 
    name="model"
    required="true"
    displayName="model"
    expert="false"
    hidden="false"
    preferred="true"
    shortDescription="The model for this component"
    extraTopLevelAttribute="Whatever I want here">
    <cc:extension>
      <fmd:expert>true</fmd:expert>
    </cc:extension>
    <cc:attribute
      name="userid"
      default="guest"
      displayName="User Id"
      expert="false"
      hidden="false"
      preferred="true"
      shortDescription="The model must have a userid property"/>
    <cc:attribute
      name="password"
      default="guest"
      displayName="Password"
      expert="false"
      hidden="false"
      preferred="true"
      shortDescription="The model must have a password property"/>
  </cc:attribute>

  <cc:attribute name="useridLabel" default="Userid:" />

  <cc:attribute name="passwordLabel" default="Password:" />

  <cc:attribute name="loginButtonLabel" default="Login" />

  <cc:attribute name="loginAction" method-signature="java.lang.String f()"
    required="true" />

<!-- end top level attributes -->

<!-- start facets -->

  <cc:facet 
    name="header"
    displayName="The header facet for the fancy component"
    expert="true"
    hidden="false"
    preferred="false"
    shortDescription="If you want a header, this is where you put it"
    anotherExtraAttribute="Lots of metadata" />

  <cc:facet 
    name="footer"
    displayName="The footer facet for the fancy component"
    expert="true"
    hidden="false"
    preferred="false"
    shortDescription="If you want a footer, this is where you put it"
    anotherExtraAttribute="Lots of metadata" />

<!-- end facets -->

<!-- start attached objects -->

  <cc:editableValueHolder
    name="userid"
    displayName="Userid field"
    expert="true"
    hidden="false"
    preferred="false"
    shortDescription="Attach a converter or validator here, if you like"
    someExtraMetadata="userid metadata" />

  <cc:editableValueHolder
    name="password"
    displayName="Password field"
    expert="true"
    hidden="false"
    preferred="false"
    shortDescription="Attach a converter or validator here, if you like"
    someExtraMetadata="password metadata" />

  <cc:actionSource
    name="login"
    displayName="Login button"
    expert="true"
    hidden="false"
    preferred="false"
    shortDescription="Attach an actionListener here, if you like"
    someExtraMetadata="login metadata" />

<!-- end attached objects -->

  <b:timeWastingTag />

</cc:interface>

<cc:implementation>

  <cc:renderFacet name="header" />

  <p><h:outputLabel for="#{cc.clientId}:userid" 
                    value="#{cc.attrs.useridLabel}" /> 
     <h:inputText id="userid" /></p>

  <p><h:outputLabel for="#{cc.clientId}:password" 
                    value="#{cc.attrs.passwordLabel}" /> 
     <h:inputText id="password" /></p>

  <p><h:commandButton value="#{cc.attrs.loginButtonLabel}"
                      action="#{cc.attrs.loginAction}" /></p>

  <cc:renderFacet name="footer" />


</cc:implementation>

</body>

</html>
